package com.haoyeteng.sxbd.modular.business.model;

import java.io.Serializable;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author haoyeteng123
 * @since 2019-06-27
 */
@TableName("bus_order")
public class Order extends Model<Order> {

    private static final long serialVersionUID = 1L;

    /**
     * 订单号
     */
    @TableId(value = "order_id",type = IdType.INPUT)
    private String orderId;
    /**
     * 用户Id
     */
    @TableField("user_id")
    private Integer userId;
    /**
     * 支付方式(1.支付宝;2.微信;3.银行转账)
     */
    @TableField("pay_type")
    private Integer payType;
    /**
     * 汇款凭证号
     */
    @TableField("swift_no")
    private String swiftNo;
    /**
     * 支付状态(1.待支付;2已支付)
     */
    @TableField("pay_state")
    private Integer payState;
    /**
     * 订单金额(总数)
     */
    @TableField("order_price")
    private BigDecimal orderPrice;
    /**
     * 订单状态（0作废，1正常）
     */
    @TableField("order_state")
    private Integer orderState;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 付款时间
     */
    @TableField("pay_time")
    private Date payTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 删除标记
     */
    @TableField("flag")
    @TableLogic
    private Integer flag;

    /**
     * 订单明细 非数据库字段
     */
    @TableField(exist = false)
    private List<OrderDtl> details;

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getSwiftNo() {
        return swiftNo;
    }

    public void setSwiftNo(String swiftNo) {
        this.swiftNo = swiftNo;
    }

    public Integer getPayState() {
        return payState;
    }

    public void setPayState(Integer payState) {
        this.payState = payState;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }

    public Integer getOrderState() {
        return orderState;
    }

    public void setOrderState(Integer orderState) {
        this.orderState = orderState;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    @Override
    protected Serializable pkVal() {
        return this.orderId;
    }

    public List<OrderDtl> getDetails() {
        return details;
    }

    public void setDetails(List<OrderDtl> details) {
        this.details = details;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId='" + orderId + '\'' +
                ", userId=" + userId +
                ", payType=" + payType +
                ", swiftNo='" + swiftNo + '\'' +
                ", payState=" + payState +
                ", orderPrice=" + orderPrice +
                ", orderState=" + orderState +
                ", createTime=" + createTime +
                ", payTime=" + payTime +
                ", updateTime=" + updateTime +
                ", flag=" + flag +
                ", details=" + details +
                '}';
    }
}
